<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="./favicon.ico">
    <link rel="stylesheet" href="./css/bootstrap.min.css" />
    <script src="./js/jquery-3.3.1.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
    <title>静态资管理系统</title>
    <style>
      html,
      body {
        width: 100%;
        height: 100%;
        overflow: hidden;
      }
      #detailIframe {
        width: 100%;
        height: 100%;
      }
      .go-back {
        position: fixed;
        left: 50%;
        top: 20px;
      }
    </style>
  </head>
  <body>
    <a href="./index.html">
      <button type="button" class="btn btn-danger go-back">返回列表页</button>
    </a>
    <iframe id="detailIframe" src="" frameborder="0"></iframe>
    <script>
      $(function() {
        function GetUrlParam(paraName) {
          var url = document.location.toString()
          var arrObj = url.split('?')
          if (arrObj.length > 1) {
            var arrPara = arrObj[1].split('&')
            var arr
            for (var i = 0; i < arrPara.length; i++) {
              arr = arrPara[i].split('=')
              if (arr != null && arr[0] == paraName) {
                return arr[1]
              }
            }
            return ''
          } else {
            return ''
          }
        }

        // 获取url参数
        var name = GetUrlParam('name')
        $('#detailIframe').attr('src', location.origin + '/upload' + name)
      })
    </script>
  </body>
</html>
